<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | fastadmin: https://www.fastadmin.net/
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 邮箱验证码接口
// +----------------------------------------------------------------------
namespace app\api\controller;

use app\admin\model\Staff;
use app\common\controller\Api;
use app\common\library\Ems as Emslib;
use app\common\model\ItemModel;
use app\common\model\ProblemModel;
use app\common\model\StaffModel;
use app\member\model\Member;
use think\facade\Hook;
use think\facade\Validate;

/**
 * @title 个人中心

 */
class User extends Api
{

//    protected $noNeedLogin = ['*'];
    public function getUser(){
        $data = (new StaffModel())->getUser($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

    public function updateUser(){
        $data = (new StaffModel())->updateUser($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

    public function updatePassword()
    {
        $data = (new StaffModel())->updatePassword($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    public function problem()
    {
        $data = (new ProblemModel())->problem($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

    public function loginOut(){
        $data = (new StaffModel())->loginOut($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }

}
